<script setup lang="ts">
type SocialLoginType = "wechat" | "qq" | "email";

// 定义emits
const emit = defineEmits<{
  (e: "login", type: SocialLoginType): void;
}>();

// 处理社交登录
const handleSocialLogin = (type: SocialLoginType) => {
  emit("login", type);
};
</script>

<template>
  <div class="other-login">
    <div class="separator">
      <span class="separator-text">其他登录方式</span>
    </div>
    <div class="social-login">
      <el-button
        icon="Wechat"
        class="social-btn wechat-btn"
        @click="handleSocialLogin('wechat')"
      />
      <el-button
        icon="Qq"
        class="social-btn qq-btn"
        @click="handleSocialLogin('qq')"
      />
      <el-button
        icon="Mail"
        class="social-btn email-btn"
        @click="handleSocialLogin('email')"
      />
    </div>
  </div>
</template>

<style scoped lang="scss">
@use "../styles/variables.scss" as vars;

.other-login {
  margin-top: 30px;
  .separator {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    &::before,
    &::after {
      content: "";
      flex: 1;
      height: 1px;
      background-color: vars.$border-color;
    }
    .separator-text {
      padding: 0 15px;
      font-size: 14px;
      color: vars.$secondary-color;
    }
  }
  .social-login {
    display: flex;
    justify-content: center;
    gap: 24px;
    .social-btn {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 0;
      font-size: 20px;
      transition: all 0.3s ease;
      border: 1px solid #f2f3f5;
      &:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }
    }
    .wechat-btn {
      color: #07c160;
    }
    .qq-btn {
      color: #12b7f5;
    }
    .email-btn {
      color: #ff7d00;
    }
  }
}
</style>
